@extends('layouts.layouts')
@section('title')
    <title>后台首页</title>
@endsection
@section('content')
    <link rel="stylesheet" href="/lib/layer/theme/default/layer.css"/>
    <script type="text/javascript" src="/lib/layer/layer.js"></script>
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li><a href="/wechat/list">推送课程列表</a></li>
                <li class="active">课程列表</li>
            </ul>
        </div>
        <div class="main-content">
            <div class="main-content">
                <div class="btn-toolbar list-toolbar">
                    <form class="form-inline" action="" method="get">
                        @if(!$subscribe->count())
                        <a href="/wechatSet/push/set"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" ><i class="fa fa-plus"></i> 新增</button></a>
                        @endif
                    </form>
                </div>
            <div class="row">
                <div class="col-sm-12 col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading no-collapse">课程列表</div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>推送课程</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($subscribe as $sub)
                                <tr>
                                    <td>{{$sub->id}}</td>
                                    <td>{{$sub->courseClass?$sub->courseClass->title:''}}</td>
                                    <td>
                                        <a class="btn btn-success btn-xs" href="/wechatSet/push/updateSet?id={{$sub->id}}">编辑</a>
                                        <button class="btn btn-danger btn-xs" data-id="{{$sub->id}}" onclick="delete(this)">删除</button>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">

    </script>
@endsection